// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import i18n from './locales'
import { VueAxios } from './utils/request'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
import themePluginConfig from '../config/themePluginConfig'
import config from '@/config/defaultSettings'
import './assets/less/common.less'
import 'ant-design-vue/dist/antd.less'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock'

// 全局过滤器
import filters from "./utils/time"; // global filters

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

import bootstrap from './core/bootstrap'
import './core/lazy_use' // use lazy load components
import './permission' // permission control //免登陆需注释

import './utils/filter' // global filter
import './global.less' // global style
import "@/assets/css/reset.css"
import storage from "store";
Vue.prototype.$storage = storage
import { nav } from '@/utils/nav'
Vue.prototype.$nav = nav

import configs from "@/config/defaultSettings"
Vue.prototype.$configs = configs;

import moment from 'moment'
Vue.prototype.$moment = moment;

Vue.config.productionTip = false

// mount axios to `Vue.$http` and `this.$http`
Vue.use(VueAxios)
// use pro-layout components
Vue.component('pro-layout', ProLayout)
Vue.component('page-container', PageHeaderWrapper)
Vue.component('page-header-wrapper', PageHeaderWrapper)

//统计图
// 引入echarts
import echarts from "@/utils/echarts";
Vue.prototype.$echarts = echarts


import loadding from '@/core/directives/loadding' //自定义loading
Vue.use(loadding)


window.umi_plugin_ant_themeVar = themePluginConfig.theme

const vues = new Vue({
  router,
  store,
  i18n,
  // init localstorage, vuex
  created: bootstrap,
  render: h => h(App)
}).$mount('#app')

export default vues